/**
 * @author [siwi]
 * @email [siwi@siwi.me]
 * @create date 2017-09-16 11:42:46
 * @modify date 2017-09-16 11:42:46
 * @desc [description]
*/


const { mongoose, Schame } = require('../Mongoose')

const Table = new Schame({
    // 用户id
    user_id: {
        type: String
    },
    // 名称
    name: {
        type: String,
        unique: true,
        required: true,
    },
    // 秘钥
    secret: {
        type: String,
        unique: true
    },
    // 回调
    redirect: {
        type: String
    },
    // 是否私人令牌
    personal_access_client:{
        type: Boolean
    },
    // 是否密码客户端
    password_client: {
        type: Boolean
    },
    // 是否失效
    revoked: {
        type: Boolean,
        default: false
    },
    // 是否通过审核
    verified: {
        type: Boolean,
        default: false
    }
})
const OauthClient = mongoose.model('OauthClient', Table)
module.exports = OauthClient